< previous page page_188 next page >

Page 188
Note
If you own a copy of the Professional or Enterprise editions of Visual Basic, you can get a free copy of Visual Modeler at
www.microsoft.com/vbasic in the Owner's Area. Have the registration number of your copy of Visual Basic handy.

LOGGING TESTING ACTIVITIES
For some applications, you may find it helpful to log runtime errors in a text file or even a database such as Access. In such cases, it's faster to use text files located in log directory located on the client or server machine.

Understanding the Need for Logging Class Test Results
Logging class test results helps in two ways. First, the test/quality assurance team can use the results to compare with the team's test script results. Second, the tasks of current and future maintenance programmers will be made much less tedious because they can easily pinpoint class methods that are in error. For corporate developers, this speeds up the process of resolving user complaints. For entrepreneurial and commercial developers, customer satisfaction will be greatly improved, giving you an edge on your competition.
Recording Test Logs
Remember the testReturns method of the TestClass earlier? Recall the error handling code:
Public Function testReturns(ByVal argInteger As Variant) _
As TestClass
    Dim anotherTestClass As TestClass
    On Error GoTo errtestReturns
    
Exit Function
errtestReturns:
    Dim sMethodName As String
    sMethodName = testReturns
    theErrorHandler.processVBTypeError Err, Me, sMethodName
    sMethodName = 
End Function
The theErrorHandler object has a form, as illustrated in Figure 8.3.

 
< previous page page_188 next page >

If you like this book, buy it!